package com.ss.android.topic.d;

import android.view.View;
import android.widget.AbsListView;

import com.ss.android.common.util.NetworkUtils;
import com.ss.android.newmedia.a.AbstractFooter;

final class d implements AbsListView.OnScrollListener {
    private final a a;

    d(a arg1) {
        this.a = arg1;

    }

    public final void onScroll(AbsListView arg6, int arg7, int arg8, int arg9) {
        int v3 = View.GONE;
        if(this.a.f != null && this.a.c.getCount() > 0 && (this.a.f.mHasMore)) {
            if(!NetworkUtils.isNetworkAvailable(this.a.getContext())) {
                AbstractFooter v0 = this.a.b;
                v0.mCurrentState = 2;
                v0.mTextView.setText(com.ss.android.article.browser.R.string.ss_error_network_error);
                v0.mFooterContent.setVisibility(View.VISIBLE);
                v0.mMoreView.setVisibility(v3);
                v0.mAltView.setVisibility(View.VISIBLE);
                v0.mLoadingView.setVisibility(v3);
                v0.mRetryView.setVisibility(v3);
                v0.hideSofaView();
            }
            else {
                if(arg8 >= this.a.c.getCount() && this.a.b.mCurrentState != 6) {
                    this.a.b.switchToMoreContent();
                    return;
                }

                if(arg8 + arg7 != arg9) {
                    return;
                }

                if(this.a.f.mLoading) {
                    return;
                }

                this.a.f.load();
                this.a.a(arg6, arg7, arg8, arg9);
            }
        }
    }

    public final void onScrollStateChanged(AbsListView arg1, int arg2) {
    }
}

